home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / music / 5mods_2.arj / DEFAULTS.MOD < prev   
Text File  |  1994-01-24  |  9KB  |  303 lines

  1. ┌───────────────────────────────────────────────────────────────────────────┐
  2. │ Mod Name  : New Default Section  Mod Author: Hackmaster 'J' 1@6101 WWIVnet│
  3. │                                                                           │
  4. │ Difficulty: Block Read           Date      : 04DEC93                      │
  5. │                                                                           │
  6. │ Version   : WWIV 4.23            File Name : HJ07C.MOD or (ZIP)           │
  7. │                                                                           │
  8. │ Description: This mod combines the T command in the xfer section and the  │
  9. │              D command from the main menu.  I've also added a couple      │
  10. │              other things in to make this a One-Stop-Default Section!     │
  11. │                                                                           │
  12. └───────────────────────────────────────────────────────────────────────────┘
  13. -------------------------------------------------------------------------
  14. 04DEC93:  Updated code for 4.23
  15. -------------------------------------------------------------------------
  16. 29JAN93:  Added the functions I omitted, by popular demand
  17. -------------------------------------------------------------------------
  18. 24JAN93:  I found the need to add some of the new userrec where users could
  19. edit it so this mod was born!
  20. -------------------------------------------------------------------------
  21.  
  22.  
  23. Most modifications are made in DEFAULTS.C so lets start there, Search
  24. for function void print_cur_stat and replace it with this one, also add
  25. the function void name_change right after it as it is below.
  26.  
  27. /* MOD */
  28. void print_cur_stat(void)
  29. {
  30.   char s[81],s1[81];
  31.   userrec ur;
  32.  
  33.   outchr(12);
  34.   npr("1. Alias : %-27.27s 9. Screen Size  : %d X %d\r\n",
  35.         thisuser.name,
  36.         thisuser.screenchars,
  37.         thisuser.screenlines);
  38.   npr("   RN    : %-27.27s A. ANSI         : %s\r\n",
  39.         thisuser.realname,
  40.         (thisuser.sysstatus & sysstatus_ansi)?
  41.         ((thisuser.sysstatus & sysstatus_color)? "Color":"Monochrome"):
  42.         "No ANSI");
  43.   npr("2. Strt  : %-27.27s B. Pause Screen : %s\r\n",
  44.         thisuser.street,
  45.         (thisuser.sysstatus & sysstatus_pause_on_page)?"Yes":"No");
  46.   sprintf(s1,"%s, %s  %s (%s)",
  47.          thisuser.city,
  48.          thisuser.state,
  49.          thisuser.zipcode,
  50.          thisuser.country);
  51.   npr("   City  : %-27.27s C. Expert Mode  : %s\r\n",
  52.         s1,
  53.         (thisuser.sysstatus & sysstatus_expert)?"On":"Off");
  54.   if (thisuser.defprot)
  55.     strcpy(s1,prot_name(thisuser.defprot));
  56.   else
  57.     strcpy(s1,"None.");
  58.   npr("3. Voice : %-27.27s D. Protocol     : %-20.20s\r\n",
  59.         thisuser.phone,
  60.         s1);
  61.   npr("4. Data  : %-27.27s E. Auto-Scan Dir: %s\r\n",
  62.         thisuser.dataphone,
  63.         (thisuser.sysstatus & sysstatus_nscan_file_system)?"Yes":"No");
  64.   npr("5. Comp  : %-27.27s F. Extra Descrp : %d line%s\r\n",
  65.         ctypes[thisuser.comp_type],
  66.         thisuser.num_extended,thisuser.num_extended==1?"":"s");
  67.   if ((thisuser.forwardsys==0) && (thisuser.forwardusr==0))
  68.     strcpy(s1,"Normal");
  69.   else {
  70.     if (thisuser.forwardsys)
  71.       sprintf(s1,"Forward to %s #%u @%u.",
  72.       net_networks[thisuser.net_num].name,
  73.       thisuser.forwardusr,thisuser.forwardsys);
  74.     else {
  75.       if (thisuser.forwardusr==65535)
  76.         strcpy(s1,"Closed");
  77.       else {
  78.         read_user(thisuser.forwardusr,&ur);
  79.         if (ur.inact & inact_deleted) {
  80.           thisuser.forwardusr=0;
  81.           strcpy(s1,"Normal");
  82.         } else
  83.           sprintf(s1,"Forward to %s",nam(&ur,thisuser.forwardusr));
  84.       }
  85.     }
  86.   }
  87.   if (thisuser.wwiv_regnum)
  88.     sprintf(s,"%ld",thisuser.wwiv_regnum);
  89.   else
  90.     strcpy(s,"None.");
  91.   npr("6. Mail  : %-27.27s G. File Tagging : %s\r\n",
  92.          s1,
  93.          (thisuser.sysstatus & sysstatus_no_tag)?"Off":"On");
  94.   npr("7. Editor: %-27.27s H. WWIV Reg #   : %s\r\n",
  95.         ((thisuser.defed) && (thisuser.defed<=numed))?
  96.         editors[thisuser.defed-1].description:"None.",s);
  97.   npr("8. Confer: %-27.27s I. Option lines : %d\r\n\r\n",
  98.         (thisuser.sysstatus & sysstatus_conference)?"On":"Off",
  99.         thisuser.optional_val);
  100.   npr("J. Configure N-scan for Message Bases  K. Change Password\r\n");
  101.   npr("L. Configure N-scan for Directories    M. Update Macros\r\n");
  102.   npr("N. Change Colors                       O. Change Language\r\n\r\n");
  103. }
  104.  
  105.  
  106. void name_change(int usernum)
  107. {
  108.   char s[30],t[81];
  109.   userrec u;
  110.  
  111.   read_user(usernum,&u);
  112.   nl();
  113.   npr("Enter new alias (or return for no change)? ");
  114.   input(s,30);
  115.   nl();
  116.   if (s[0]) {
  117.     if (finduser(s)<1) {
  118.       dsr(u.name);
  119.       sprintf(t,"   $*$ %s Changed Alias to: %s",u.name,s);
  120.       sl1(0,t);
  121.       pl(t);
  122.       strcpy(u.name,s);
  123.       isr(usernum,u.name);
  124.       write_user(usernum,&u);
  125.       topscreen();
  126.     }
  127.     else
  128.       pl("   That alias is already being used!  Alias not changed.");
  129.   }
  130.   else
  131.     pl("    * Alias not changed *");
  132. }
  133. /* END MODIFY */
  134. ------------------------------------------------------------------------
  135. Farther down in the file replace the function void defaults with
  136. the one below:
  137.  
  138. /* MOD */
  139. void defaults(void)
  140. {
  141.   int i,i1,i2,done;
  142.   char s[81],s1[81],s2[81],ch;
  143.  
  144.   done=0;
  145.   do {
  146.     print_cur_stat();
  147.     tleft(1);
  148.     if (hangup)
  149.       return;
  150.     nl();
  151.     helpl=4;
  152.     prt(2,get_string(477));
  153.     ch=onek("Q?123456789ABCDEFGHIJKLMNO");
  154.     switch(ch) {
  155.       case 'Q':
  156.         done=1;
  157.         break;
  158.       case '?':
  159.         print_cur_stat();
  160.         break;
  161.       case '1':
  162.         name_change(usernum);
  163.         break;
  164.       case '2':
  165.         input_street();
  166.         input_city();
  167.         input_state();
  168.         input_country();
  169.         input_zipcode();
  170.         break;
  171.       case '3':
  172.         input_phone();
  173.         break;
  174.       case '4':
  175.         input_dataphone();
  176.         break;
  177.       case '5':
  178.         input_comptype();
  179.         break;
  180.       case '6':
  181.         modify_mailbox();
  182.         break;
  183.       case '7':
  184.         select_editor();
  185.         break;
  186.       case '8':
  187.         if (thisuser.sysstatus & sysstatus_conference)
  188.           thisuser.sysstatus ^= sysstatus_conference;
  189.         nl();
  190.         prt(5,get_string(1152));
  191.         if (yn())
  192.           thisuser.sysstatus |= sysstatus_conference;
  193.         changedsl();
  194.         break;
  195.       case '9':
  196.         input_screensize();
  197.         break;
  198.       case 'A':
  199.         input_ansistat();
  200.         if (thisuser.sysstatus & sysstatus_extra_color)
  201.           thisuser.sysstatus ^= sysstatus_extra_color;
  202.         nl();
  203.         prt(5,get_string(480));
  204.         if (yn())
  205.           thisuser.sysstatus |= sysstatus_extra_color;
  206.         break;
  207.       case 'B':
  208.         thisuser.sysstatus ^= sysstatus_pause_on_page;
  209.         break;
  210.       case 'C':
  211.         thisuser.sysstatus ^= sysstatus_expert;
  212.         break;
  213.       case 'D':
  214.         nl();
  215.         pl(get_string(570));
  216.         nl();
  217.         helpl=40;
  218.         i=get_protocol(xf_down);
  219.         if (i>=0)
  220.           thisuser.defprot=i;
  221.         break;
  222.       case 'E':
  223.         nl();
  224.         pl(get_string(811));
  225.         outstr(get_string(812));
  226.         if (thisuser.sysstatus & sysstatus_nscan_file_system)
  227.           thisuser.sysstatus -= sysstatus_nscan_file_system;
  228.         if (yn())
  229.           thisuser.sysstatus += sysstatus_nscan_file_system;
  230.         break;
  231.       case 'F':
  232.         nl();
  233.         pl(get_string(813));
  234.         pl(get_string(814));
  235.         outstr(get_string(815));
  236.         pln(thisuser.num_extended);
  237.         prt(5,"? ");
  238.         helpl=41;
  239.         input(s,3);
  240.         if (s[0]) {
  241.           i=atoi(s);
  242.           if ((i>=0) && (i<=10))
  243.             thisuser.num_extended=i;
  244.         }
  245.         break;
  246.       case 'G':
  247.         thisuser.sysstatus ^= sysstatus_no_tag;
  248.         break;
  249.       case 'H':
  250.         enter_regnum();
  251.         break;
  252.       case 'I':
  253.         optional_lines();
  254.         break;
  255.       case 'J':
  256.         config_qscan();
  257.         break;
  258.       case 'K':
  259.         input_pw1();
  260.         break;
  261.       case 'L':
  262.         helpl=24;
  263.         config_nscan();
  264.         break;
  265.       case 'M':
  266.         make_macros();
  267.         break;
  268.       case 'N':
  269.         change_colors();
  270.         break;
  271.       case 'O':
  272.         if (num_languages>1)
  273.           input_language();
  274.         break;
  275.     }
  276.   } while ((!done) && (!hangup));
  277. }
  278. /* END MODIFY */
  279. ------------------------------------------------------------------------
  280. Now remove function void xfer_defaults from file XFEROVL.C as it is
  281. no longer needed with the new defaults function.
  282. ------------------------------------------------------------------------
  283. Remove the following code from function void dlmainmenu in file BBS.C:
  284.  
  285. K = line to keep
  286. - = line to remove
  287.  
  288. K      case 'S':
  289. K        searchall();
  290. K        break;
  291. -      case 'T':
  292. -        helpl=32;
  293. -        xfer_defaults();
  294. -        break;
  295. K      case 'U':
  296. K        helpl=17;
  297.  
  298. ------------------
  299. Thats it recompile  -- As always its not my fault if you BBS melts Down
  300.  
  301. Hackmaster 'J' 1@6101 WWIVnet
  302.  
  303.